package com.example.mobile2032021606168xmy0427classtest;

import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private TextView tvMainimport;
    private Button btnMainclick;
    private RecyclerView rvMainparking;
    private TextView tvMainImport;
    private Button btnMainClick;
    private RecyclerView rvMainParking;
    private List<Parking>list=new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        initData();
    }

    private void initView() {
        tvMainImport = (TextView) findViewById(R.id.tv_main_import);
        btnMainClick = (Button) findViewById(R.id.btn_main_click);
        rvMainParking = (RecyclerView) findViewById(R.id.rv_main_parking);
    }
    private  void initData(){
        list.add(new Parking("星湖城停车场","22公里","30","汕头市龙湖区","5元/时","更多信息"));
        list.add(new Parking("小公园停车场","45公里","10","汕头市金平区","3元/时","更多信息"));
        list.add(new Parking("帝豪酒店停车场","6公里","22","汕头市龙湖区","6元/时","更多信息"));
        list.add(new Parking("十一合停车场","5公里","10","汕头市龙湖区","9元/时","更多信息"));
        list.add(new Parking("新溪停车场","12公里","12","汕头市龙湖区","2元/时","更多信息"));

    }
}